Skip to content

feat(projects): implement project center and asset library - #119

Merged
nighca merged 16 commits into
1024XEngineer:mainfrom
huyanxius:feat/118-project-asset-workspace
Aug 5, 2026
Merged

feat(projects): implement project center and asset library#119
nighca merged 16 commits into
1024XEngineer:mainfrom
huyanxius:feat/118-project-asset-workspace

Conversation

@huyanxius

@huyanxius huyanxius commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

实现 Projects 模块的项目中心与项目资产工作区,覆盖项目浏览、项目导航、角色资产库和角色详情,并按真实后端字段展示造型、动作与帧。

Closes #118

合并顺序:先合并 #117,再合并本 PR。本分支直接从主仓库 main 创建,只包含 Projects 的 14 个提交,不包含 #117 的提交历史。后端运行还需要 #75 合并并部署。

Why

  • main 目前只有 Projects 路由骨架,项目、角色和资产层级还不能读取正式数据。
  • 前期验证页使用过 Mock 与 livedemo 资源,本 PR 将正式实现收敛到后端 Project / Character 契约,不把演示数据带入生产包。
  • Projects 负责资产浏览与管理,不重复实现 Workflow Editor、新建项目流程或生成流程。

Change Description

  • 实现项目中心的分页浏览、进入项目和删除确认,并保留明确禁用的新建项目入口。
  • 实现项目工作区、角色资产库和角色详情路由,按 Project → Character → Outfit → Action → Frame 浏览资产。
  • 实现 Project 4 个端点与 Character 5 个端点的 DTO 映射、分页和完整 character_data 更新。
  • 为动作卡、帧展开、空状态、删除和分页补齐页面与接口测试。
  • 动作模板和导出没有可接入的正式后端能力,当前入口保持禁用并显示原因。

Implementation Approach

  • 页面只从 entities 公共入口调用 projectApischaracterApis,snake_case 到 camelCase 的转换留在对应实体模块。
  • /projects/:projectId/* 使用独立项目工作区路由,资产库与角色详情保留同一项目上下文。
  • 测试数据只存在于 Vitest 的 HTTP 替身;生产代码不包含 Mock API、演示实体或 livedemo 资源。
  • 复用 feat(frontend): add shared API client infrastructure #117 提供的 HTTP、响应外壳、分页和 Token 注入边界,不复制其实现或提交历史。

Screenshots

以下截图来自本地接口契约环境。测试数据与图片仅用于页面核对,不进入生产源码或构建产物。

项目中心

项目中心

角色资产库

角色资产库

角色详情与动作帧

角色详情与动作帧

Testing

在本地将本分支与 feat/shared-api-client 临时合并且不创建提交,完整门禁通过:

  • npm run format:check:通过,55 个文件。
  • npm run lint:通过。
  • npm run typecheck:通过。
  • npm run test:通过,10 个测试文件、38 项测试。
  • npm run build:通过,Vite 构建 96 个模块。
  • git merge-tree --write-tree HEAD feat/shared-api-client:无冲突。
  • 独立性检查:merge base 为 upstream/main,Projects 差异不包含 frontend/src/shared/api/*

Follow-ups

  • 新建项目流程、Workflow Editor 与登录流程分别由后续 PR 实现。
  • Action Template 等待后端提供存储与接口;导出等待正式能力完成资产字段接线。
  • 后端仍需处理 Character 名称落库、资源归属隔离和 Project 删除级联。

Related

Projects need a domain adapter for the backend contract in PR 75.

Map project DTOs, enums, pagination queries, creation, lookup, and deletion.

Project pages can use typed data without handling transport fields.
Project transport mapping must stay aligned with the backend contract.

Cover pagination, DTO mapping, writes, deletion, and bearer token injection.

Contract regressions fail before reaching the project pages.
The asset library needs the persisted character hierarchy from PR 75.

Map character, outfit, action, and frame data with complete tree updates.

Pages can browse formal assets without generated or mock-only fields.
Character tree mapping carries the core project asset contract.

Cover list, detail, create, update, delete, and token-aware requests.

Nested asset serialization remains protected by executable tests.
Pages consume entities through the layer public entry point.

Export the implemented project and character APIs with their domain types.

Project pages keep respecting the existing dependency boundary.
Backend project and character lists can span multiple pages.

Add a business-neutral pagination control and export it from shared UI.

List pages can navigate all records without duplicating controls.
Projects need an entry page and a persistent project-level workspace.

Implement paged project browsing, deletion, navigation, and project constraints.

Users can enter one project before managing its contained assets.
Project assets need formal browsing below the project workspace.

Implement character cards, outfit selection, stacked actions, and frame expansion.

The UI reflects only fields persisted by the character contract.
Project pages require a nested route boundary outside the global shell.

Mount the asset library and character detail beneath the project workspace.

Direct routes preserve project context without duplicating global navigation.
Project navigation currently changes state without visual continuity.

Add restrained entry, route, dialog, and card transitions with reduced motion.

Page changes remain legible without changing the established palette.
Page tests need realistic HTTP responses without production mock data.

Provide a test-only Project and Character backend with configurable pagination.

Production bundles remain independent from demonstration fixtures.
Project entry and workspace behavior need route-level regression coverage.

Cover real HTTP data, deletion, pagination, constraints, and disabled boundaries.

The project navigation flow remains verifiable without browser fixtures.
Asset browsing must preserve project ownership and frame ordering.

Cover pagination, empty states, outfits, stacked actions, and frame expansion.

Unsupported template and export actions stay explicit and inert.
The architecture documents still describe project pages as placeholders.

Record the formal workspace, backend mappings, merge order, and excluded flows.

Reviewers can distinguish current behavior from backend and future work.
@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
windup Ready Ready Preview Aug 5, 2026 6:17am

@huyanxius
huyanxius marked this pull request as ready for review August 4, 2026 20:09

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a build blocker and one brittle load path. Details are inline.

Comment thread frontend/src/entities/project/index.ts
Comment thread frontend/src/pages/project-detail/index.tsx Outdated
Keep the project workspace usable when the optional character count request is unavailable.

Load the project and character count with Promise.allSettled, preserving project errors while applying the count only on success.

Add a regression test for a failed character-list request.
@johnnyzhang-eng

Copy link
Copy Markdown

集成验证:本 PR 的只读链路已在真实后端上跑通,附三条反馈

main + #117 + 本 PR + #111 + #110 合成一个本地集成分支(四个 PR 只有一处冲突,且冲的是两个 PR 各自误提交到仓库根目录的同名 _PR说明.md,不是代码),构建通过、npm test 63/63、lint 零告警,然后连一台真实部署的后端做了端到端验证。

跑通的链路:项目列表 → 项目详情 → 资产库 → 角色详情 → 点动作卡展开完整帧序列。帧图全部从对象存储正常加载、无裂图、无白屏、无 pageerror。项目规格(视角/朝向/精灵尺寸/画风)与后端返回一致。

1. 读取链路对帧数没有硬断言,与生成链路不同——建议注释写明

生成链路要求「候选图正好 4 张」「动作帧正好 16 帧且 index 连续」,不满足会直接 throw。但读取链路没有这个约束:我特意用一个 20 帧的动作做控制样本,资产页正常显示「攻击 · 12 FPS · 20 帧 · 单次」。

这两条路径的差异建议在代码注释里写清楚,否则容易被误读成「系统只支持 16 帧」,进而在预埋数据、导入既有资产时凑帧数。

2. 组合根缺失,generation / media 两个适配器目前接不上

全仓搜 createGenerationApis / createMediaApis 的调用点,除测试外为 0。app.tsx 事实上是组合根,但目前没有任何 DI/Provider,本 PR 的页面靠模块级单例自取数据。要把 #110 的 SSE 接进来,还差在组合根注入四样:baseUrluserIdtransport: { request, stream }resolveImageSize(projectId)(最后一项的注释里已明确要求由组合根经 ProjectApis 提供)。

不是本 PR 的责任,但如果没人认领这一层,#110/#111 会一直是编译得过、界面上摸不到的状态。

3. 首页两个主 CTA 指向的路由仍是占位页

/quick-start/workflow-editor/:runId/playtest/... 三个路由目前都只显示「本次只提交模块划分与接口,页面实现进后续 PR」。首页那两张大卡片直接指过去,任何人第一次点开都会落到占位页。

建议要么把 CTA 暂时指向本 PR 的项目中心(这是当前唯一走得通的入口),要么在占位页上写清楚"实现在 #95 / #102",避免被当成坏掉了。

@huyanxius

Copy link
Copy Markdown
Collaborator Author

感谢这次真实后端集成验证,三点我们确认如下:

  1. 读取链路按后端返回展示帧数,不增加 4/16 帧硬断言;生成链路的帧数约束与读取链路分开,后续在对应生成侧 PR 中说明。
  2. 组合根的通用注入边界属于 feat(generation): add validated SSE task adapter #110/feat(media): add validated upload adapter #111 及后续生成、媒体接入范围。本 PR 只负责 Projects 的资产浏览链路,不在这里扩展。
  3. 首页 CTA 继续保留现有 Quick Start / Workflow Editor 入口,相关页面属于 feat(quick-start): add guided creation and animation review #95/feat: 将工作流编辑器接入 WorkflowRun 与 WorkflowController(Refs #87) #102 的后续实现,本 PR 不改变入口语义。

因此这三点不作为 #119 的代码改动,后续按对应 PR / Issue 跟进。

Comment thread frontend/src/entities/character/index.ts
Comment thread frontend/src/entities/character/index.ts
@nighca

nighca commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
image

这个 CI failure 处理下?

@huyanxius

Copy link
Copy Markdown
Collaborator Author
image 这个 CI failure 处理下?

收到,因为这个 PR 需要依赖于 PR#117,而之前PR#117还没有到主仓库所以会出现问题,现在 CI 已经过了

@nighca
nighca merged commit 711e739 into 1024XEngineer:main Aug 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 实现项目中心与项目资产工作区

3 participants